package com.smartleanx.module.hrm.dal.mysql.employee;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.smartleanx.framework.mybatis.core.mapper.BaseMapperX;
import com.smartleanx.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
import com.smartleanx.module.hrm.dal.dataobject.employee.EmployeeSeparationRecordDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

import java.util.Collection;
import java.util.List;

/**
 * 离职信息 Mapper
 *
 * @author tengcj
 */
@Mapper
public interface EmployeeSeparationRecordMapper extends BaseMapperX<EmployeeSeparationRecordDO> {

    default List<EmployeeSeparationRecordDO> getToBeSeparatedList(){
        return selectList(new LambdaQueryWrapper<EmployeeSeparationRecordDO>()
                .ne(EmployeeSeparationRecordDO::getApproveResult, BpmProcessInstanceStatusEnum.RUNNING.getStatus()));
    }

    default List<EmployeeSeparationRecordDO> getSeparatedList(Long employeeId) {
        return selectList(EmployeeSeparationRecordDO::getEmployeeId, employeeId);

    }

    default List<EmployeeSeparationRecordDO> selectListByEmployeeId(Collection<Long> employeeIdList) {
        return selectList(EmployeeSeparationRecordDO::getEmployeeId, employeeIdList);
    }
}
